package cn.edu.scau.cmi.xiaowenyang.staticFactoryMethod;

public class Factory {
	public Insurance getInsurance(String name) {
		Insurance insurance = null;
		switch (name) {
		case "司机受伤":
			insurance = new DriverInjuryInsurance();
			break;
		case "汽车损坏":
			insurance = new CarBrokenInsurance();
			break;
		case "人员伤亡":
			insurance = new CasualtyInsurance();
			break;
		}
		return insurance;
	}
}
